<%@ page language="java" import="java.util.*,protrade.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录成功</title>
</head>
<body style="text-align:center;">
<form name="postForm" action="MenuStudent.jsp" method="post">
<%
    	
    	String no = request.getParameter("snum");
    	String password = request.getParameter("password");
    	ProsellerDao sdao;
    	ProManageDao mdao;
    	//ProbuyerDao bdao;
    	if(no.charAt(0)=='s'||no.charAt(0)=='S'){
    		sdao = new ProsellerDaoJDBC();
	    	if(sdao.slogin(no,password)!=1){
	    		response.sendRedirect("ProLogin.jsp");
			}
	    	else
	    	{
	    		
%>
<td>ID：<input type="text" id="a" name="snum" value=<%=no%>></td>
   		<p>登陆成功！</p>
   	<input type="submit" value="Menu" />
   		<% 
	   		}
	  	}
    	else if(no.charAt(0)=='m'||no.charAt(0)=='M'){
    		mdao = new ProManageDaoJDBC();
	    	if(mdao.mlogin(no,password)!=1){
	    		response.sendRedirect("ProLogin.jsp");
			}
	    	else
	    	{
	    		
%>
<td>ID：<input type="text" id="a" name="snum" value=<%=no%>></td>
   		<p>登陆成功！</p>
   	<input type="submit" value="Menu" />
   		<% 
	   		}
	  	}
    	else if(no.charAt(0)>'0'||no.charAt(0)<='9'){
    		bdao = new ProbuyerDaoJDBC();
	    	if(bdao.blogin(no,password)!=1){
	    		response.sendRedirect("ProLogin.jsp");
			}
	    	else
	    	{
	    		
%>
<td>ID：<input type="text" id="a" name="snum" value=<%=no%>></td>
   		<p>登陆成功！</p>
   	<input type="submit" value="Menu" />
   		<% 
	   		}
	  	}
    	else response.sendRedirect("ProLogin.jsp");
		%>
</form>
</body>
</html>